import torch

# t = torch.tensor([[[1, 2, 3],
#                    [4, 5, 6]],
#                   [[3, 2, 1],
#                    [6, 5, 4]]])
# print(t)
# print("--------")
# bt = torch.cuda.ByteTensor(t.size()).bool()
# print(bt)
# print("--------")
# bt.zero_()
# print(bt)

coo_mask = torch.tensor([[[False, False, False, False, False, False, False],
                          [False, False, False, False, False, False, False],
                          [False, False, True, False, False, False, False],
                          [False, False, False, False, False, False, False],
                          [False, False, False, False, False, False, False],
                          [False, False, False, False, False, False, False],
                          [False, False, False, False, False, False, False]]])

noo_mask = torch.tensor([[[True, True, True, True, True, True, True],
                          [True, True, True, True, True, True, True],
                          [True, True, False, True, True, True, True],
                          [True, True, True, True, True, True, True],
                          [True, True, True, True, True, True, True],
                          [True, True, True, True, True, True, True],
                          [True, True, True, True, True, True, True]]])

target_tensor = torch.randn(1, 7, 7, 30)

# print(coo_mask.unsqueeze(-1))
# print(coo_mask.unsqueeze(-1).expand_as(target_tensor))

# t = torch.tensor([[[1]], [[2]], [[3]]])
# print(t.expand_as(torch.tensor([[[1, 1, 1]], [[1, 1, 1]], [[1, 1, 1]]])))

predict_tensor = torch.randn(1, 7, 7, 30)
print(predict_tensor[coo_mask.unsqueeze(-1).expand_as(target_tensor)])
